<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>添加角色信息</title>
		<link type="text/css" rel="stylesheet" href="css/table.css" />
		<script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
		<script type="text/javascript">
	function saveRole(){
		var name=$("#name").val();
		var type=$("#type").val();
		if($.trim(name)==''||$.trim(name)=='null'){
			$("#errorinfo").html("<img src=\"image/cuo.gif\" width=\"16\" height=\"16\" />&nbsp;<font color=\"#FF0000\">名称不能为空！</font>");
			return;
		}else{
			$("#errorinfo").html("");
		}
		var param={"role.name":name,"role.type":type};
		$.post("saveRole.action",param,function(data){
			if(data=='success'){
				alert("添加角色成功！");
				window.close();
				window.opener.location.reload();
			}else{
				alert("添加角色失败！");
			}
		
		});
	}
</script>
	</head>
	<body>
		<table align="center" border="0" cellpadding="0" cellspacing="0"
			width="98%">
			<tbody>
				<tr>
					<td style="background: url('image/wsoa_window_002.gif');" width="1"></td>
					<td style="background: url('image/wsoa_window_002.gif');">
						<table border="0" cellpadding="0" cellspacing="0">
							<tbody>
								<tr>
									<td align="center" style="background: url('image/wsoa_window_002.gif');" width="10">
										<img src="image/center_19.gif">
									</td>
									<td align="center"
										style="background: url('image/wsoa_window_002.gif');"></td>
									<td>
										系统管理 &gt; 基础设置 &gt; 角色管理 &gt; 角色添加
									</td>
								</tr>
							</tbody>
						</table>
					</td>
					<td style="background: url('image/wsoa_window_002.gif');" width="1"></td>
				</tr>
				<tr>
					<td style="background: url('image/wsoa_window_010.gif');" width="1">
						&nbsp;
					</td>
					<td>
	
		<table align="center"  style="width:450px;margin-top: 10px" class="table5" frame="box">
			<tr class="reigh_list2">
				<td colspan="2" align="center">
					添加角色
				</td>
			</tr>
			<tr class="reigh_list4">
				<td class="table5 bgcolor5" align="right" width="80px">
					角色名称：
				</td>
				<td class="table5" align="left">
					<input type="text" id="name" maxlength="20" />
					<span id="errorinfo"></span>
				</td>
			</tr>
				<tr class="reigh_list4">
				<td class="table5 bgcolor5" align="right" width="80px">
					角色类型：
				</td>
				<td class="table5" align="left">
					<select id="type">
						<option value="1" selected="selected">普通员工</option>
						<option value="2">领导</option>
						<option value="3">管理员</option>
						<option value="4">超级管理员</option>
					</select>
				</td>
			</tr>
		</table>
		<table align="center" style="border: 0">
			<tr>
				<td>
					<input type="button" onclick="saveRole()" class="button_04" value="保存" />
				</td>
				<td>
					<input type="button" onclick="window.close()" class="button_04" value="关闭" />
				</td>
			</tr>
		</table>
		
		</td>
					<td style="background: url('image/wsoa_window_006.gif');" width="1">
						&nbsp;
					</td>
				</tr>
				<tr>
					<td height="1" width="1">
						<img src="image/wsoa_window_009.gif" height="16" width="14">
					</td>
					<td style="background: url('image/wsoa_window_008.gif');"
						height="1"></td>
					<td height="1" width="1">
						<img src="image/wsoa_window_007.gif" height="16" width="12">
					</td>
				</tr>
			</tbody>
		</table>
	</body>
</html>